import request from "@/apps/admin/utils/request";

const BASE_URL = '/v1/admin'

// 获取楼层列表
export const getFloors = () => {
    return request.get(`${BASE_URL}/getFloors`)
        .then(response => response)
        .catch(error => {
            console.error('获取楼层列表失败:', error);
            throw error; // 抛出错误供上层处理
        });
};

// 创建新楼层
export const createFloor = (floorData) => {
    return request.post(`${BASE_URL}/createFloor`, floorData)
        .then(response => response)
        .catch(error => {
            console.error('创建楼层失败:', error);
            throw error; // 抛出错误供上层处理
        });
};

// 删除楼层
export const deleteFloor = (data) => {
    return request.post(`${BASE_URL}/deleteFloor`, data)
        .then(response => response)
        .catch(error => {
            console.error('删除楼层失败:', error);
            throw error; // 抛出错误供上层处理
        });
};
